import request  from "@/utils/request";
import type { DeptModel, ResultModel } from "./model/model";

// 列表查询
export const queryAllApi=()=>request.get<any,ResultModel>('/depts')

// 部门保存
export const addApi=(dept:DeptModel)=>request.post<any,ResultModel>('/depts',dept)

// 部门详情查询
export const queryInfoApi=(id:number)=>request.get(`/depts/${id}`)

// 部门修改
export const updateApi=(dept:DeptModel)=>request.put<any,ResultModel>('/depts',dept)

// 部门删除
export const deleteApi=(id:number)=> request.delete<any,ResultModel>(`/depts?id=${id}`)